import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
  redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    component: HomeView
  },
  {
    path: '/type',
    name: 'type',
    component: () => import( '../views/TypeView.vue')
  }
  ,
  {
    path: '/cart',
    name: 'cart',
    component: () => import( '../views/CartView.vue')
  }
  ,
  {
    path: '/my',
    name: 'my',
    component: () => import( '../views/MyView.vue')
  }
  ,
  {
    path: '/detail',
    name: 'detail',
    meta: {
      isHide: true
    },
    component: () => import( '../views/DetailView.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
